/*******************************************************************************
 * Copyright (c) 2008 Jakub Kornas.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Jakub Kornas - initial API and implementation
 *     Sylvain Sicard - integration in FracLite Runtime
 ******************************************************************************/

package org.objectweb.fractal.deployment.local.api;

import org.objectweb.fractal.api.Component;

/**
 * A {@link ILoader} is an {@link Object} capable of loading the code and
 * resources from the local file system. A {@link ILoader} is usually associated
 * with a {@link ModuleComponent}
 * 
 * @author <a href="mailto:jakub.kornas@inrialpes.fr">Jakub Kornas
 */
public interface ILoader {

	/**
	 * Given a description of the code to be loaded, creates a
	 * {@link ComponentFactory}. Works only if the code described by the
	 * codeDesc is accessible via this {@link ILoader}
	 * 
	 * @param codeDesc
	 *            A description of the code to be loaded. Implementation
	 *            specific
	 * @return the {@link ComponentFactory} to create {@link Component}s
	 * 
	 */
	public ComponentFactory load(Object codeDesc);

	/**
	 * @return The {@link ClassLoader} encapsulated by this {@link ILoader}
	 */
	public ClassLoader getClassLoader();

}
